{template head}
<script type="text/javascript" src="{STATICDIR}third/plupload/plupload.full.min.js"></script>
<script type="text/javascript">
function submitcheck()
{
	return true;
}

function saveInfo()
{
	if(!submitcheck())
	{
		return;
	}
	var url = '{SITE_URL}ajax/index.php?m=savePingtai';
	
	var data = $('#savedata').serialize();
		
	var callback = function(data)
	{
		if(data.sign == -2)
		{
			window.location = data.url;
		}
		else
		{
			if(data.sign == 1)
			{
				//添加成功,返回列表页
				layer.alert(data.msg,function(){
					window.location = $('#gotoList').attr('href');
				});
			}
			else
			{
				if(data.msg)
				{
					layer.msg(data.msg);
				}
				else
				{
					layer.msg('操作失败');
				}
			}
		}
	};
	makeAjax('post',url,data,callback);
}

</script>
<body>
<div class="wrapper">
	<div class="crumbs"><span style="margin: 0 5px;color: #333;font-size: 14px;">平台管理</span> &gt;<a id="gotoList" href="{SITE_URL}index.php?a=pingtaiM&m=list">平台列表</a> &gt; <span>{$title}</span><a style="float:right;font-size:13px;" href="javascript:history.go(-1);">返回</a></div>
	
	<div class="container_tit clearfix mb20 ft14">
	
	<form id="savedata">
		<input type="hidden" name="id" value="{$pingtai[id]}" />
		<h2 class="form_tit">
			平台信息
		</h2>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">平台类别：</label>
				<select class="select w150" name="pt_type" onchange="show(this);">
	            	<option {if $pingtai['pt_type']=='1'}selected{/if} value="1">固有</option>
	            	<option {if $pingtai['pt_type']=='2'}selected{/if} value="2">银行</option>
	            </select>
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">理财类型：</label>
				<select class="select w150" name="lc_type">
					{loop $lcType $k $v}
	            		<option {if $pingtai['lc_type']==$k}selected{/if} value="{$k}">{$v}</option>
	            	{/loop}
				</select>
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">平台名称：</label>
				<input type="text" id="pt_name" name="pt_name" value="{$pingtai[pt_name]}" class="text w340" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">平台LOGO上传：</label>
				<a id="btn1" href="javascript:;" class="btnyellow mr15">上传图片</a>
				<img id="img_logo" src="{OSS_URL}{$pingtai[pt_logo]}"  style="max-width: 65px;height: 40px;" />
				<input type="hidden" id="logo" name="pt_logo" value="{$pingtai[pt_logo]}" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">优势描述：</label>
				<input type="text" id="pt_desc" name="pt_desc" value="{$pingtai[pt_desc]}" class="text w340" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">平台背景：</label>
				<select class="select w150" name="pt_bj">
	            	<option {if $pingtai['pt_bj']=='1'}selected{/if} value="1">上市系</option>
	            	<option {if $pingtai['pt_bj']=='2'}selected{/if} value="2">国资系</option>
	            	<option {if $pingtai['pt_bj']=='3'}selected{/if} value="3">风投系</option>
	            	<option {if $pingtai['pt_bj']=='4'}selected{/if} value="4">民营系</option>
	            </select>
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">预期年化：</label>
				<input type="text" id="pt_yqnh" name="pt_yqnh" value="{$pingtai[pt_yqnh]}" class="text w340" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">最高返利：</label>
				<input type="text" id="pt_zgfl" name="pt_zgfl" value="{$pingtai[pt_zgfl]}" class="text w340" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">风险评级：</label>
				<input type="text" id="pt_zgfl" name="pt_fxdj" value="{$pingtai[pt_fxdj]}" class="text w340" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">上线时间：</label>
				<input type="text" id="pt_sxsj" name="pt_sxsj" value="{$pingtai[pt_sxsj]}" class="text w340" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">所在地：</label>
				<input type="text" id="pt_szd" name="pt_szd" value="{$pingtai[pt_szd]}" class="text w340" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">主营业务：</label>
				<input type="text" id="pt_zyyw" name="pt_zyyw" value="{$pingtai[pt_zyyw]}" class="text w340" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">银行存管：</label>
				<input type="text" id="pt_yhcg" name="pt_yhcg" value="{$pingtai[pt_yhcg]}" class="text w340" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">平台用户量级：</label>
				<input type="text" id="pt_yhlj" name="pt_yhlj" value="{$pingtai[pt_yhlj]}" class="text w340" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">成交额度：</label>
				<input type="text" id="pt_cjed" name="pt_cjed" value="{$pingtai[pt_cjed]}" class="text w340" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">提现费用：</label>
				<input type="text" id="pt_txfy" name="pt_txfy" value="{$pingtai[pt_txfy]}" class="text w340" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">利息管理费：</label>
				<input type="text" id="pt_lxglf" name="pt_lxglf" value="{$pingtai[pt_lxglf]}" class="text w340" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">债权转让：</label>
				<input type="text" id="pt_zqzr" name="pt_zqzr" value="{$pingtai[pt_zqzr]}" class="text w340" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">注册方式：</label>
				<select class="select w150" name="pt_zcfs">
	            	<option {if $pingtai['pt_zcfs']=='1'}selected{/if} value="1">跳转注册</option>
	            	<option {if $pingtai['pt_zcfs']=='2'}selected{/if} value="2">一键注册</option>
	            </select>
			</p>
		</div>
		<div class="form_item clearfix">
			<p class="clearfix" style="height: 28px;line-height: 28px;">
				<label class="name">是否启用：</label>
				<input style="vertical-align: middle;" {if $pingtai['status'] == '1' || empty($pingtai['status'])}checked{/if} class="checkbox" type="radio" name="status" value="1" />
				<label for="resort_index" class="mr15">禁用</label>
				<input style="vertical-align: middle;" {if $pingtai['status'] == '2'}checked{/if} class="checkbox" type="radio" name="status" value="2" />
				<label for="resort_index">启用</label>
			</p>
		</div>
        <div class="form_item clearfix" style="padding-top: 20px;>
			<p class="clearfix">
			    <input type="button" class="btnblue" value="保存" onclick="saveInfo();" />
			</p>
		</div>
    </form>
    </div>
</div>
<script>
    var uploader = new plupload.Uploader({//创建实例的构造方法
        runtimes: 'html5,flash,silverlight,html4', //上传插件初始化选用那种方式的优先级顺序
        browse_button: 'btn1', // 上传按钮
        url: "{SITE_URL}ajax/object.php", //远程上传地址
        flash_swf_url: '{STATICDIR}plupload/Moxie.swf', //flash文件地址
        silverlight_xap_url: '{STATICDIR}plupload/Moxie.xap', //silverlight文件地址
        filters: {
            max_file_size: '2mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
            mime_types: [//允许文件上传类型
                {title: "files", extensions: "jpg,png,gif,jpeg"}
            ]
        },
        multi_selection: false, //true:ctrl多文件上传, false 单文件上传
        init: {
            FilesAdded: function(up, files) { //文件上传前
                if ($("#ul_pics").children("li").length > 30) {
                    ts("您上传的图片太多了！");
                    uploader.destroy();
                } else {
                    var li = '';
                    plupload.each(files, function(file) { //遍历文件
                        li += "<li id='" + file['id'] + "'><div class='progress'><span class='bar'></span><span class='percent'>0%</span></div></li>";
                    });
                    $("#ul_pics").append(li);
                    uploader.start();
                }
            },
            UploadProgress: function(up, file) { //上传中，显示进度条
         var percent = file.percent;
                $("#" + file.id).find('.bar').css({"width": percent + "%"});
                $("#" + file.id).find(".percent").text(percent + "%");
            },
            FileUploaded: function(up, file, info) { //文件上传成功的时候触发
	               var data = eval("(" + info.response + ")");
	               
	                var picurl = '{OSS_URL}';
	                $("#img_logo").attr('src',picurl+data.name);
	                $("#logo").val(data.name);
	              //  _upload_callback(data.name,data.size);
	            },
            Error: function(up, err) { //上传出错的时候触发
                layer.msg(err.message);
            },
            UploadComplete:function()
            {
            	layer.msg('上传成功');

            	//window.location = window.location;
            }
        }
    });
    uploader.init();
</script>
{template foot}